package com.htu.service.impl;

import com.htu.dao.IUserDao;
import com.htu.domain.User;
import com.htu.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements IUserService
{
    @Autowired
    private IUserDao dao;

    @Override
    public User doLogin(int id, String password)
    {
        return dao.queryUser(id, password);
    }

    @Override
    public User doLoginById(int id)
    {
        return dao.queryUserById(id);
    }

    @Override
    public boolean doUpdateUser(User user)
    {
        return dao.updateUser(user);
    }

    @Override
    public List<User> queryUserAll()
    {
        return dao.queryUserAll();
    }

    @Override
    public boolean doUpdatePassword(int id, String password)
    {
        return dao.updatePassword(id, password);
    }

    @Override
    public boolean doRegister(User user)
    {
        return dao.insertUser(user);
    }


}
